package me.ZFC.Text;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        String name = "2024107";
        String key = "123456";
        Scanner sc = new Scanner(System.in);
        for (int i = 1; i <= 3; i++) {
            System.out.println("请输入用户名");
            String s1 = sc.next();
            System.out.println("请输入密码");
            String s2 = sc.next();
            if (s1.equals(name) && s2.equals(key)) {
                System.out.println("登录成功");
                break;
            } else {
                System.out.println("登录失败");
            }
            if (i == 3) {
                System.out.println("3次登录失败");
            }
        }
    }
}
